
import java.util.Scanner;

public class Sum {

	public static void main(String[] args) {
		Scanner input=new Scanner(System.in);
		double num=input.nextDouble();
        if(num<0)
           num=num*(-1);
        int sum=0;
        int a=(int)num;
        if(a==num)
        {
        	while(num!=0)
        	{
        		int m=(int)num%10;
        		num=(int)num/10;
        		sum=sum+m;	
        	}
        }
        else
        {
        	int d=0;
        	String s="";
        	s=String.valueOf(num);
        	char[] c=s.toCharArray();
        	for(int i=0;i<c.length;i++)
        	{
        		if(c[i]!='.')
        		{
        			d=c[i]-'0';
        			sum=sum+d;
        		}
        	}
        }
	System.out.println(sum);
	}
}
